#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pyautogui
import time

def find_coordinates():
    """显示鼠标实时坐标"""
    print("坐标查找器已启动")
    print("移动鼠标到目标位置，坐标将实时更新")
    print("按Ctrl+C停止程序")
    print("-" * 30)
    
    try:
        max_x, max_y = pyautogui.size()
        print(f"屏幕分辨率: {max_x} x {max_y}")
        print("-" * 30)
        
        while True:
            x, y = pyautogui.position()
            position_str = f"X坐标: {x:<4} Y坐标: {y:<4}"
            # 清除当前行并输出新坐标
            print(position_str, end='\r')
            time.sleep(0.1)
    except KeyboardInterrupt:
        print("\n程序已停止，最后记录的坐标是:")
        print(f"X: {x}, Y: {y}")
        print("请将这些坐标值复制到binance_click.py文件中")

if __name__ == "__main__":
    print("开始查找坐标，移动鼠标到目标位置...")
    print("按Ctrl+C停止程序")
    
    find_coordinates()